package service.auth.impl;

import java.util.Map;

import model.auth.Authorities;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import service.auth.AuthoritiesService;
import core.base.page.Page;
import core.base.page.PageRequest;
import dao.auth.AuthoritiesDao;

@Service("auth.AuthoritiesService")
public class AuthoritiesServiceImpl implements AuthoritiesService {

	@Autowired
	@Qualifier("auth.AuthoritiesDao")
	private AuthoritiesDao authoritiesDao;

	public int deleteById(Long id) {
		return authoritiesDao.deleteById(id);
	}

	public Authorities getById(Long id) {		
		return authoritiesDao.getById(id);
	}

	public void insert(Authorities model) {
		authoritiesDao.insert(model);
	}

	public Page<Authorities> queryForPage(PageRequest<Map> pageReq) {
		Page<Authorities> page = authoritiesDao.queryForPage(pageReq);
		return page;
	}

	public void setAuthoritiesDao(AuthoritiesDao authoritiesDao) {
		this.authoritiesDao = authoritiesDao;
	}

}
